#ifndef _YEP_VIDEO_SURFACE_HPP
#define _YEP_VIDEO_SURFACE_HPP

#include "image.hpp"
#include "canvas.hpp"

namespace yep
{
/**
 * @brief A Encapsulated Version to SDL_Surface
 **/
class Surface: public Image, public Canvas
{
public:
    /**
     * @brief Encapsulate a surface.
     *
     * @param surface the SDL_Surface to use.
     * @param own true if the SDL_Surface have to be freed when the surface is destroyed.
     **/
    Surface( SDL_Surface *surface, bool own );

    /**
     * @brief load from the rw.
     **/
    Surface( SDL_RWops *loadFrom, bool freesrc );

    /**
     * @brief Load from a file.
     **/
    Surface( const string &file );

    /**
     * @brief Creates a new Surface;
     **/
    Surface( Uint16 width, Uint16 height, Uint8 bpp = 0, Uint32 flags = SDL_HWSURFACE );

    /**
     * @brief Copy Constructor
     **/
    Surface( const Surface &surface);

    /**
     * @brief Destructor
     **/
    ~Surface();

    /**
     * @see Drawable::draw(Canvas,Vector2)
     **/
    void draw( Canvas &canvas, const Vector2 &position );

    /**
     * @see Drawable::draw(Canvas,Vector2,Vector2,Vector2)
     **/
    void draw( Canvas &canvas, const Vector2 &position, const Vector2 &sectionPosition, const Vector2 &sectionSize );
};

}

#endif // _YEP_VIDEO_SURFACE_HPP

